/**
 *@auther: tang
 *@Date: 2021-05-04
 *Project: hotwind-egg
 *Lang: TypeScript
 */
module.exports = app => {
  const DataTypes = app.Sequelize;
  const Model = app.model.define('goods', {
    id: {
      type: DataTypes.INTEGER(11),
      allowNull: false,
      primaryKey: true,
      autoIncrement: true,
    },
    goods_name: {
      type: DataTypes.STRING(255),
      allowNull: true,
    },
    goods_desc: {
      type: DataTypes.STRING(60),
      allowNull: true,
    },
    num: {
      type: DataTypes.STRING(255),
      allowNull: true,
    },
    pclassification: {
      type: DataTypes.STRING(60),
      allowNull: true,
    },
    sclassification: {
      type: DataTypes.STRING(60),
      allowNull: true,
    },
    marterial: {
      type: DataTypes.STRING(60),
      allowNull: true,
    },
    color: {
      type: DataTypes.STRING(60),
      allowNull: true,
    },
    describe: {
      type: DataTypes.STRING(60),
      allowNull: true,
    },
    size: {
      type: DataTypes.INTEGER(2),
      allowNull: true,
    },
    state: {
      type: DataTypes.INTEGER(11),
      allowNull: true,
    },
    type_id: {
      type: DataTypes.INTEGER(11),
      allowNull: true,
    },
    shelf_life: {
      type: DataTypes.INTEGER(11),
      allowNull: true,
    },
    product_time: {
      type: DataTypes.DATE,
      allowNull: true,
    },
    expiration_time: {
      type: DataTypes.DATE,
      allowNull: true,
    },
  }, {
    tableName: 'goods',
  });

  Model.associate = function() {

  };

  return Model;
};
